﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Globalization;
using System.Xml.Serialization;
using System.Web;

namespace SEOSitemap
{
    [Serializable]
    public class SiteMapItem
    {
        private SiteMapDocument siteMapDocument;

        [XmlIgnore]
        public SiteMapDocument SiteMapDocument
        {
            get { return siteMapDocument; }
            set { siteMapDocument = value; }
        }

        private string _loc;

        [XmlElement("loc")]
        public string Loc
        {
            get { return _loc; }
            set { _loc = HttpUtility.UrlPathEncode(value); }
        }

        private string _lastmod;

        [XmlElement("lastmod")]
        public string Lastmod
        {
            get { return _lastmod; }
            set { _lastmod = value; }
        }

        [XmlIgnore]
        public DateTime LastmodParsed
        {
            get { return Convert.ToDateTime(_lastmod); }
            set { _lastmod = Helper.ToW3CDateTime(value); }
        }
    }
}
